/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package respaldos;

import dao.DaoUsuarios;
import java.sql.SQLException;
import modelos.Usuario;

/**
 *
 * @author Adrian
 */
public class BeanIngresar {

    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public Usuario getUserActual() {
        return userActual;
    }

    public void setUserActual(Usuario userActual) {
        this.userActual = userActual;
    }
    /**
     * Creates a new instance of BeanIngreso
     */
    private String cedula;
    private String passwd;
    private Usuario userActual;

    public String Hola(String a) {
        return "s";
    }

    public String Ingresar() throws SQLException {
        Usuario user = DaoUsuarios.getInstance().login(cedula, passwd);
        if (user != null) {
            userActual = user;
            return "yes";
        } else {
            return "no";
        }
    }
    
    public String retorno(){
        return "returnIndex";
    }

    /**
     * Creates a new instance of BeanIngresar
     */
    public BeanIngresar() {
    }
}
